# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=egl-wayland
pkgver=1.1.13
pkgrel=1
epoch=2
pkgdesc="EGLStream-based Wayland external platform"
url="https://github.com/NVIDIA/egl-wayland"
arch=(loong64 x86_64)
license=(MIT)
depends=(
  eglexternalplatform
  wayland
)
makedepends=(
  git
  'libglvnd>=1.3.4'
  meson
  wayland-protocols
)
provides=(libnvidia-egl-wayland.so)
_commit=69ae9cf07bbec3b00a682918bf0dc845e9896771  # tags/1.1.13
source=(
  "git+$url#commit=$_commit"
  10_nvidia_wayland.json
)
b2sums=('SKIP'
        'b10206c742e8966d1192b9b0604137e6b296d2be74a437841c63844c0716343578b11565a34fb4c534d5908c0b5775305581b68039a6ff9ed7421c9d385a2b7a')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
  install -Dt "$pkgdir/usr/share/egl/egl_external_platform.d" -m644 10_nvidia_wayland.json
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 $pkgname/COPYING
}

# vim:set sw=2 sts=-1 et:
